package com.d3works.apps.hr.service.batch;

import com.d3works.apps.base.db.repo.BatchRepository;
import com.d3works.apps.base.service.administration.AbstractBatch;
import com.d3works.apps.hr.db.Employee;
import com.d3works.apps.hr.db.repo.EmployeeRepository;
import com.d3works.apps.hr.service.leave.management.LeaveManagementService;
import com.d3works.apps.hr.service.publicHoliday.PublicHolidayHrService;
import com.google.inject.Inject;

public abstract class BatchStrategy extends AbstractBatch {

  protected LeaveManagementService leaveManagementService;

  @Inject protected EmployeeRepository employeeRepository;

  @Inject protected PublicHolidayHrService publicHolidayService;

  public BatchStrategy(LeaveManagementService leaveManagementService) {
    super();
    this.leaveManagementService = leaveManagementService;
  }

  public BatchStrategy() {
    super();
  }

  protected void updateEmployee(Employee employee) {

    employee.addBatchSetItem(batchRepo.find(batch.getId()));

    incrementDone();
  }

  protected void setBatchTypeSelect() {
    this.batch.setBatchTypeSelect(BatchRepository.BATCH_TYPE_HR_BATCH);
  }
}
